-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FFM-11212 Metrics enhancements #150
Conversation
analyticsservice/analytics.go
Outdated
analyticsChan chan analyticsEvent | ||
evaluationsAnalyticsMx *sync.Mutex | ||
targetAnalyticsMx *sync.Mutex | ||
seenTargetsMx *sync.RWMutex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opted for a RWMutex here because the seen targets cache should mostly be reads once it's filled up. It's possible a user could send all unique targets, but it is more likely in my estimation that targets will be reused.
analyticsservice/analytics.go
Outdated
seenTargets map[string]bool | ||
timeout time.Duration | ||
logger logger.Logger | ||
metricsClient metricsclient.ClientWithResponsesInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a pointer to an interface which I removed as it prevented me from using my own types for testing purposes.
What
Splits evaluation and target metrics into their own caches:
globalTarget
, this meant that we would miss targets if the evaluation didn't change.Implement seen targets:
Testing